/** * @preserve * Plugin Name: dflip * Description: dflip - 3D & 2D FlipBook * * Author: Deepak Ghimire * Author URI: http://dearhive.com */ "use strict";var DFLIP=DFLIP||{},PRESENTATION=DFLIP;!function(e,t){e.version="1.7.30",e.PAGE_MODE={SINGLE:1,DOUBLE:2,AUTO:null},e.SINGLE_PAGE_MODE={ZOOM:1,BOOKLET:2,AUTO:null},e.CONTROLSPOSITION={HIDDEN:"hide",TOP:"top",BOTTOM:"bottom"},e.DIRECTION={LTR:1,RTL:2},e.LINK_TARGET={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4},e.CORNERS={TL:"tl",TR:"tr",BL:"bl",BR:"br",L:"l",R:"r",NONE:null},e.SOURCE_TYPE={IMAGE:"image",PDF:"pdf",HTML:"html"},e.DISPLAY_TYPE={WEBGL:"3D",HTML:"2D"},e.PAGE_SIZE={AUTO:0,SINGLE:1,DOUBLEINTERNAL:2};var n,i,o,a,s=e.defaults={webgl:!0,webglShadow:!0,soundEnable:!0,search:!1,height:"auto",autoEnableOutline:!1,autoEnableThumbnail:!1,overwritePDFOutline:!1,enableDownload:!0,duration:800,direction:e.DIRECTION.LTR,pageMode:e.PAGE_MODE.AUTO,singlePageMode:e.SINGLE_PAGE_MODE.AUTO,backgroundColor:"#fff",forceFit:!0,transparent:!1,hard:"none",openPage:1,annotationClass:"",autoPlay:!1,autoPlayDuration:5e3,autoPlayStart:!1,maxTextureSize:1600,minTextureSize:256,rangeChunkSize:524288,icons:{altnext:"ti-angle-right",altprev:"ti-angle-left",next:"ti-angle-right",prev:"ti-angle-left",end:"ti-angle-double-right",start:"ti-angle-double-left",share:"ti-sharethis",help:"ti-help-alt",more:"ti-more-alt",download:"ti-download",zoomin:"ti-zoom-in",zoomout:"ti-zoom-out",fullscreen:"ti-fullscreen",fitscreen:"ti-arrows-corner",thumbnail:"ti-layout-grid2",outline:"ti-menu-alt",close:"ti-close",search:"ti-search",doublepage:"ti-book",singlepage:"ti-file",sound:"ti-volume",facebook:"ti-facebook",google:"ti-google",twitter:"ti-twitter-alt",mail:"ti-email",play:"ti-control-play",pause:"ti-control-pause"},text:{toggleSound:"Turn on/off Sound",toggleThumbnails:"Toggle Thumbnails",toggleOutline:"Toggle Outline/Bookmark",previousPage:"Previous Page",nextPage:"Next Page",toggleFullscreen:"Toggle Fullscreen",zoomIn:"Zoom In",zoomOut:"Zoom Out",toggleHelp:"Toggle Help",singlePageMode:"Single Page Mode",doublePageMode:"Double Page Mode",downloadPDFFile:"Download PDF File",gotoFirstPage:"Goto First Page",gotoLastPage:"Goto Last Page",play:"Start AutoPlay",pause:"Pause AutoPlay",share:"Share",mailSubject:"I wanted you to see this FlipBook",mailBody:"Check out this site {{url}}",loading:"Loading"},allControls:"altPrev,pageNumber,altNext,play,outline,thumbnail,zoomIn,zoomOut,fullScreen,share,download,search,more,pageMode,startPage,endPage,sound",moreControls:"download,pageMode,startPage,endPage,sound",hideControls:"",controlsPosition:e.CONTROLSPOSITION.BOTTOM,paddingTop:30,paddingLeft:20,paddingRight:20,paddingBottom:30,enableAnalytics:!1,scrollWheel:!0,onCreate:function(e){},onCreateUI:function(e){},onFlip:function(e){},beforeFlip:function(e){},onReady:function(e){},zoomRatio:1.5,pageSize:e.PAGE_SIZE.AUTO,pdfjsSrc:"js/libs/pdf.min.js",pdfjsCompatibilitySrc:"js/libs/compatibility.js",pdfjsWorkerSrc:"js/libs/pdf.worker.min.js",threejsSrc:"js/libs/three.min.js",mockupjsSrc:"js/libs/mockup.min.js",soundFile:"sound/turn2.mp3",imagesLocation:"images",imageResourcesPath:"images/pdfjs/",cMapUrl:"cmaps/",enableDebugLog:!1,canvasToBlob:!1,enableAnnotation:!0,pdfRenderQuality:.9,textureLoadFallback:"blank",stiffness:3,backgroundImage:"",pageRatio:null,pixelRatio:window.devicePixelRatio||1,thumbElement:"div",spotLightIntensity:.22,ambientLightColor:"#fff",ambientLightIntensity:.8,shadowOpacity:.15,linkTarget:e.LINK_TARGET.BLANK,sharePrefix:"flipbook-",loadMoreCount:!1},r="WebKitCSSMatrix"in window||document.body&&"MozPerspective"in document.body.style,l="onmousedown"in window,c=(window,navigator.userAgent),d=e.utils={drag:{left:0,right:1,none:-1},mouseEvents:l?{type:"mouse",start:"mousedown",move:"mousemove",end:"mouseup"}:{type:"touch",start:"touchstart",move:"touchmove",end:"touchend"},html:{div:"
",img:"=0&&v<=P?x.TL:v>=b-P&&v<=b?x.BL:v>P&&v
Upgrade to a new one").addClass("df-old-browser"),i.removeClass("df-loading"),s;var l=null==a.backgroundImage||""==a.backgroundImage?"":"url('"+a.backgroundImage+"')";return s.container.css({position:"relative",overflow:"hidden",backgroundColor:a.backgroundColor,backgroundImage:l}),1==s.options.isLightBox&&s.analytics({eventAction:"Open Book",options:s.options}),s.init(r,o),null!=s.options.onCreate&&s.options.onCreate(s),s}return _(i,n),i.prototype.init=function(n){var i,o,a=this,r=a.target,l=a.options;if(1==n){i=function(){a.container.css({minHeight:300,minWidth:300}),a.stage=new j(E(a.options,{container:a.container})),a.stage.previewObject=a,a.contentProvider=new W(a.contentSource,(function(i){var o={pageCount:i.pageCount,stackCount:6,segments:20,width:i.bookSize.width,height:i.bookSize.height};a.target=r=a.stage.target=new MOCKUP.Book(E(a.options,o),a.stage),a.extendtarget(),A(a.container,a),r.ui=a.ui,r.container=a.container,i.webgl=n,i.setTarget(a.target),r.getContentLayer=function(t){var n=r.direction==e.DIRECTION.RTL,i=a.stage.cssScene.divLeft.element,o=a.stage.cssScene.divRight.element;return k(r._activePage),F(r)?n?i:o:t%2==0?n?o:i:n?i:o},r.stage=a.stage,r.flipCallback=function(){if(a.contentProvider){a.contentProvider.review("flipCallback");var n,i,o=k(r._activePage),s=r.getPageByNumber(o),l=r.getPageByNumber(o+1),c=r.parent.cssScene.divLeft,d=r.parent.cssScene.divRight;r.pageMode,e.PAGE_MODE.SINGLE,r.direction,e.DIRECTION.RTL,null!=s&&null!=c&&(n=Math.abs(s.geometry.boundingBox.max.x-s.geometry.boundingBox.min.x),i=Math.abs(s.geometry.boundingBox.max.z-s.geometry.boundingBox.min.z),c.rotation.y=.9*-Math.atan2(i,n),c.position.z=.8*i,c.position.x=i/2.5,t(c.element).css({width:n,left:-n/2})),null!=l&&null!=d&&(n=Math.abs(l.geometry.boundingBox.max.x-l.geometry.boundingBox.min.x),i=Math.abs(l.geometry.boundingBox.max.z-l.geometry.boundingBox.min.z),d.rotation.y=.9*Math.atan2(i,n),d.position.z=.8*i,d.position.x=-i/2.5,t(d.element).css({width:n,left:n/2})),null!=a.options.onFlip&&a.options.onFlip(a)}},r.resize=void a.resize(),r.updatePageCallback=function(){a.ui.update(),a.checkCenter(),a.stage.renderRequestPending=!0};var s=t(a.stage.cssScene.divLeft.element),l=t(a.stage.cssScene.divRight.element);r.preFlipCallback=function(){s.empty(),l.empty(),null!=a.options.beforeFlip&&a.options.beforeFlip(a),a.playSound()},t(window).trigger("resize"),s.css({width:i.bookSize.width,height:i.bookSize.height,left:-i.bookSize.width/2}),l.css({width:i.bookSize.width,height:i.bookSize.height,left:i.bookSize.width/2}),r.ease=TWEEN.Easing.Cubic.InOut,r.contentProvider=i,r.duration=a.options.duration,r.gotoPage(r._activePage),r.flipCallback(),1==a.options.isLightBox&&a.analytics({eventAction:"Book Ready",options:a.options}),null!=a.options.onReady&&a.options.onReady(a)}),l,a)},o=function(){MOCKUP.defaults.anisotropy=0,MOCKUP.defaults.groundTexture="blank",THREE.skipPowerOfTwo=!0,U(),null!=i&&i()},null==window.MOCKUP?(a.updateInfo(l.text.loading+" WEBGL 3D ..."),"function"==typeof define&&define.amd&&window.requirejs?(requirejs.config({paths:{three:s.threejsSrc.replace(".js","")},shim:{three:{exports:"THREE"}}}),require(["three"],(function(t){return window.THREE=t,T(s.mockupjsSrc+"?ver="+e.version,(function(){o()})),t}))):"function"==typeof define&&define.amd?require(["three",s.threejsSrc.replace(".js","")],(function(e,t){e((function(){}))})):T(s.threejsSrc+"?ver="+e.version,(function(){T(s.mockupjsSrc+"?ver="+e.version,(function(){o()}))}))):o()}else a.contentProvider=new W(a.contentSource,(function(e){var i={pageCount:e.pageCount,contentSourceType:e.contentSourceType};a.target=r=new G(E(a.options,i),a.container),a.target.previewObject=a,a.extendtarget(),A(a.container,a),e.webgl=n,e.setTarget(a.target),e.waitPeriod=2,r.ease=TWEEN.Easing.Quadratic.InOut,r.duration=a.options.duration,r.container=a.container,r.updatePageCallback=function(){a.ui.update(),a.checkCenter()},r.resize=void a.resize(),t(window).trigger("resize"),r.flipCallback=function(){a.contentProvider&&(a.contentProvider.review("flipCallback"),null!=a.options.onFlip&&a.options.onFlip(a))},r.preFlipCallback=function(){null!=a.options.beforeFlip&&a.options.beforeFlip(a),a.playSound()},r.gotoPage(r._activePage),r.flipCallback(),null!=a.options.onReady&&a.options.onReady(a),a.analytics({eventAction:"Book Ready",options:a.options})}),l,a)},i.prototype.extendtarget=function(){var e=this;e.target.previewObject=e,e.target.reset=function(){for(var t=0;t>>16,61!==c[1]&&(s[l++]=u>>>8),61!==c[0]&&(s[l++]=u),d=0));return s};n&&(t=new n([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])),i&&!o.toBlob&&(o.toBlob=function(e,t){if(t||(t="image/png"),this.mozGetAsFile)e(this.mozGetAsFile("canvas",t));else if(this.msToBlob&&/^\s*image\/png\s*(?:$|;)/i.test(t))e(this.msToBlob());else{var i,o=Array.prototype.slice.call(arguments,1),l=this[s].apply(this,o),c=l.indexOf(","),d=l.substring(c+1),u=a.test(l.substring(0,c));Blob.fake?((i=new Blob).encoding=u?"base64":"URI",i.data=d,i.size=d.length):n&&(i=u?new Blob([r(d)],{type:t}):new Blob([decodeURIComponent(d)],{type:t})),e(i)}},o.toDataURLHD?o.toBlobHD=function(){s="toDataURLHD";var e=this.toBlob();return s="toDataURL",e}:o.toBlobHD=o.toBlob)}(window),function(){if("performance"in window==!1&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==!1){var e=window.performance.timing&&window.performance.timing.navigationStart?window.performance.timing.navigationStart:Date.now();window.performance.now=function(){return Date.now()-e}}}(),function(){var e,t,n=n||(e=[],{getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)},update:function(t){if(0===e.length)return!1;var n=0;for(t=null!=t?t:window.performance.now();n1?s(e[i],e[i-1],i-o):s(e[a],e[a+1>i?i:a+1],o-a)},Bezier:function(e,t){for(var i=0,o=e.length-1,a=Math.pow,s=n.Interpolation.Utils.Bernstein,r=0;r<=o;r++)i+=a(1-t,o-r)*a(t,r)*e[r]*s(o,r);return i},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var i=n.Interpolation.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:(t=[1],function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}),CatmullRom:function(e,t,n,i,o){var a=.5*(n-e),s=.5*(i-t),r=o*o;return(2*t-2*n+a+s)*(o*r)+(-3*t+3*n-2*a-s)*r+a*o+t}}},window.TWEEN=n}(),DFLIP.createBlob=function(e,t){if("undefined"!=typeof Blob)return new Blob([e],{type:t});var n=new MozBlobBuilder;return n.append(e),n.getBlob(t)},DFLIP.createObjectURL=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,n){if("undefined"!=typeof URL&&URL.createObjectURL){var i=DFLIP.createBlob(t,n);return URL.createObjectURL(i)}for(var o="data:"+n+";base64,",a=0,s=t.length;a>2]+e[(3&r)<<4|l>>4]+e[a+1>6:64]+e[a+2=s.offsetItems*s.itemHeight){var n=parseInt(t/o,10)-s.offsetItems;s._renderChunk(s.container,n<0?0:n),s.lastRepaintY=t}s.lastScrolled=Date.now(),null!=s.scrollFn&&s.scrollFn(),e.preventDefault&&e.preventDefault()}s.dispose=function(){s.container&&s.container.parentNode&&s.container.parentNode.removeChild(s.container),s.container.removeEventListener("scroll",r)},s.container.addEventListener("scroll",r)}return e.prototype.reset=function(e){this.screenItemsLen=Math.ceil(e/this.itemHeight),this.cachedItemsLen=this.screenItemsLen+2*this.offsetItems;var t=parseInt(this.lastRepaintY/this.itemHeight,10)-this.offsetItems;this.needReset=!0,this._renderChunk(this.container,Math.max(t,0))},e.prototype.createRow=function(e){var t;return this.generatorFn&&((t=this.generatorFn(e)).classList.add("df-vrow"),t.style.position="absolute",t.style.top=e*this.itemHeight+"px",t.setAttribute("index",e)),t},e.prototype._renderChunk=function(e,t){var n=null==this.range;this.range=this.range||{min:0,max:this.cachedItemsLen};var i=this.range,o=i.min,a=i.max,s=!!n||t>=o;if(n||t!=o||0!=this.needReset){var r,l=n?o:s?a:t;l=l>this.totalRows?this.totalRows:l<0?0:l;var c=t+this.cachedItemsLen;for(c=c>this.totalRows?this.totalRows:c,r=l;r